/* PatternParser.java
 * Author: liuex
 * 2007-12-16 ����03:35:15
 *
 * Note: 
 */
package org.lex.utils.logging.pattern;

import java.util.ArrayList;

public class PatternParser {
	private PatternLexer lexer = null;

	public PatternParser(String pattern) {
		this.lexer = new PatternLexer(pattern);
	}

	public Pattern[] parse() {
		ArrayList<Pattern> patterns = new ArrayList<Pattern>();
		while (lexer.hasNext())
			patterns.add(lexer.nextPattern());
		return patterns.toArray(new Pattern[0]);
	}
}
